var mongoose = require('mongoose');
//镇压警告
mongoose.set('strictQuery', true);
mongoose.connect('mongodb://127.0.0.1:27017/mongoose_test')



//监听打开事件
mongoose.connection.once('open',function () {
  console.log('open connection....')
})

//监听断开事件
mongoose.connection.once('close',function () {
  console.log('close connection....')
})

//断开链接，不用
mongoose.disconnect();